package oop4;

/**
 * @author oldliu
 * @since 1.0
 */
public class Card {
    private String name;
    private String phone;
    private int points; // 积分
    private String address;
    private boolean married;

    public Card() {

    }

    public Card(String name, String phone) {
        //this.name = name;
//        this.phone = phone;
        this(name, phone, 0, null);

        System.out.println("两个参数的构造方法");
    }

    public Card(String name, String phone, int points) {
        this(name, phone, points, null);
//        this.name = name;
//        this.phone = phone;
//        this.points = points;
    }

    public Card(String name, String phone, int points, String address) {
        this.name = name;
        this.phone = phone;
        this.points = points;
        this.address = address;
    }

    public boolean isMarried() {
        return married;
    }

    public void setMarried(boolean married) {
        this.married = married;
    }

    public int getPoints() {
        return points;
    }

    //改积分的方法
    public void setPoints(int points) {
        if (points < 0) {
            System.out.println("积分不能为负数");
            return;
        }
        this.points = points;
    }

    public void show() {
        System.out.println("这个会员信息如下:");
        System.out.println("姓名" + name + ",手机号" + phone);
        System.out.println("地址是" + address + ",积分是" + points);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

//    public void setPhone(String phone) {
//        this.phone = phone;
//    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
